<?php


namespace App\Http\Controllers\Admin\Log;


use App\Http\Controllers\Admin\BaseController;
use App\Models\Log\Operation;
use App\Repositories\Log\OperationRepository;
use Illuminate\Http\Request;

class OperationController extends BaseController
{
    public function __construct()
    {
        $this->set('log/operation');
    }

    function index()
    {
        return $this->view('index');
    }

    function pager(OperationRepository $rep, Request $request)
    {
        return $rep->adminPager($request->all());
    }

    public function detail($id, OperationRepository $rep)
    {
        $info = $rep->detailInfo($id);
        return $this->view('detail', ['info' => $info]);
    }

    public function params($id)
    {
        $info = Operation::find($id);
        return $this->view('params', ['info' => $info]);
    }
}